package cn.itheima.feign;

import cn.itheima.orders.vo.OrderOverViewVO;
import cn.itheima.sys.vo.BusinessDataVO;
import cn.itheima.sys.vo.SalesTop10ReportVO;
import cn.itheima.sys.vo.TurnoverReportVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

@FeignClient(name = "sky-orders", contextId = "order")
public interface OrderClient {

    @GetMapping("/admin/order/getSumByDate")
    List<TurnoverReportVO> getSumByDate(@RequestParam("begin") LocalDate begin, @RequestParam("end") LocalDate end);

    @GetMapping("/admin/order/countByMap")
    Integer countByMap(@RequestParam Map<String, Object> map);


    @GetMapping("/admin/order/getBusinessData")
    BusinessDataVO getBusinessData(@RequestParam("begin") LocalDateTime begin, @RequestParam("end") LocalDateTime end);

    @GetMapping("/admin/order/getBusinessListData")
    List<BusinessDataVO> getBusinessListData(@RequestParam("begin") LocalDateTime begin, @RequestParam("end") LocalDateTime end);

    @GetMapping("/admin/order/countDishAndSetmealByTime")
    List<SalesTop10ReportVO> countDishAndSetmealByTime(@RequestParam("begin") LocalDate begin, @RequestParam("end") LocalDate end);

    @GetMapping("/admin/order/getAllCountByStatus")
    OrderOverViewVO getAllCountByStatus(@RequestParam("start") LocalDateTime start, @RequestParam("end") LocalDateTime end);
}
